package tree;

import visitor.IRTreePrint;


public class BINOP extends tree.Exp {
  public int binop;
  public tree.Exp left, right;
  public BINOP(int b, tree.Exp op1, tree.Exp op2) {
    binop=b; left=op1; right=op2; 
  }
  public final static int PLUS=0, MINUS=1, MUL=2, DIV=3, 
		   AND=4,OR=5,LSHIFT=6,RSHIFT=7,ARSHIFT=8,XOR=9;
  
  public ExpList kids() {return new ExpList(left, new ExpList(right,null));}
  public Exp build(ExpList kids) {
    return new BINOP(binop, (Exp)kids.head, (Exp)kids.tail.head);
  }
  
	public void accept(IRTreePrint v){
		v.visit(this);
	}
}

